import org.zjx.db.ItemSlotDB;
import org.zjx.enums.prop.SlotStatus;
import org.zjx.enums.prop.SlotType;
import org.zjx.model.prop.ItemSlot;

public class SlotData {
    public static void main(String[] args) {
        ItemSlotDB slotDB = new ItemSlotDB();

        // Clear existing data
        slotDB.clearData();

        // Create slots for each SlotType
        createSlotsForType(slotDB, SlotType.INVENTORY, 20);
        createSlotsForType(slotDB, SlotType.EXTENDED_INVENTORY, 20);
        createSlotsForType(slotDB, SlotType.QUEST_ITEMS, 20);
        createSlotsForType(slotDB, SlotType.TEMP, 6);
        createSlotsForType(slotDB, SlotType.EQUIPMENT, 6);
        createSlotsForType(slotDB, SlotType.SPECIAL_EQUIP, 4);
        createSlotsForType(slotDB, SlotType.PET_EQUIPMENT, 32);
        createSlotsForType(slotDB, SlotType.STORAGE, 400);
        createSlotsForType(slotDB, SlotType.ARTIFACT_BAG, 20);
        createSlotsForType(slotDB, SlotType.EQUIPPED_ARTIFACT, 4);

        System.out.println("Slot data initialization completed!");
    }

    private static void createSlotsForType(ItemSlotDB slotDB, SlotType slotType, int count) {
        for (int i = 0; i < count; i++) {
            ItemSlot slot = new ItemSlot();
            slot.setSlotType(slotType);
            slot.setPosition(i); // Positions typically start from 1
            slot.setStatus(SlotStatus.NORMAL);
            slotDB.insert(slot);
        }
        System.out.printf("Created %d slots for %s%n", count, slotType.getDisplayName());
    }
}